package com.hcryan.djm.controller;

import com.hcryan.djm.service.MinioService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @author ryanwdj
 * @since 2025/5/4
 */

@RestController
@RequestMapping("/minio")
@Slf4j
@Api("文件存储")
public class MinioController {

    @Autowired
    private MinioService minioService;

    /**
     * 预览图片
     *
     * @param objectName
     * @param response
     */
    @GetMapping("/image")
    public void preview(String objectName, HttpServletResponse response) {
        minioService.getImage(objectName, response);
    }
}
